library(lavaan)
library(semPlot)
library(semTools)
#FFM + HH OVERALL (Common Source & Non-Common Source) ####
correl = lav_matrix_lower2full(
c(1,
0.211715797123219,	1,
0.420527937576375,	0.27,	1,
-0.148416187270875,	0.25,	0.2,	1,
0.150791906364563,	0.14,	0.16,	0.09,	1,
-0.00973603121181242,	0.19,	0.21,	0.21,	0.27,	1,
0.12,	0.1,	0.22,	0.13,	0.12,	0.23,	1,
0.273,	0.14,	0.14,	0.11,	0.16,	0.12,	0.627,	1))
rownames(correl) = colnames(correl) = c(
"HH",
"Conscientiousness",
"Agreeableness",
"EmotionalStability",
"Openness",
"Extraversion",
"TFL_C",
"LdEf")
library(lavaan)
library(semPlot)
library(semTools)
#FFM + HH OVERALL (Common Source & Non-Common Source) ####
correl = lav_matrix_lower2full(
c(1,
0.211715797123219,	1,
0.420527937576375,	0.27,	1,
-0.148416187270875,	0.25,	0.2,	1,
0.150791906364563,	0.14,	0.16,	0.09,	1,
-0.00973603121181242,	0.19,	0.21,	0.21,	0.27,	1,
0.12,	0.1,	0.22,	0.13,	0.12,	0.23,	1,
0.273,	0.14,	0.14,	0.11,	0.16,	0.12,	0.627,	1))
rownames(correl) = colnames(correl) = c(
"HH",
"Conscientiousness",
"Agreeableness",
"EmotionalStability",
"Openness",
"Extraversion",
"TFL_C",
"LdEf")
harmonic = 6558.112414
Model1a = '
LdEf ~ a * TFL_C
TFL_C ~ b1 * Extraversion
TFL_C ~ b2 * Agreeableness
'
results1a = sem(Model1a, sample.cov = correl, sample.nobs = harmonic)
standardizedsolution(results1a)
summary(results1a)
parameterEstimates(results1a)
standardizedsolution(results1a)
monteCarloMed("a * b1", object = standardizedSolution(results1a))
summary(results1a)
summary(results1a, standardized = TRUE)
inspect(results1a)
?inspect
lanInspect(result1b)
lavInspect(result1b)
lavInspect(results1a)
lavInspect(results1a, "std.all")
lavInspect(results1a, "std.all")$beta
monteCarloMed("a * b1", object = lavInspect(results1a, "std.all")$beta)
monteCarloMed("a * b1", object = lavInspect(results1a, "std.all")$beta[1])
?monteCarloMed
print(monteCarloMed("scale(a) * scale(b1)", object = results1a))
print(monteCarloMed("std(a) * std(b1)", object = results1a))
print(monteCarloMed("std.all(a) * std.all(b1)", object = results1a))
summary(result1a)
summary(results1a)
parameterEstimates(results1a)
harmonic = 6558.112414
Model1a = '
LdEf ~ a * TFL_C
TFL_C ~ b1 * Extraversion
TFL_C ~ b2 * Agreeableness
'
results1a = sem(Model1a, sample.cov = correl, sample.nobs = harmonic, standardized = TRUE)
?`semPlot-package`
standardizedSolution(results1a)
standardizedSolution(results1a)[1,]
standardizedSolution(results1a)[2,]
harmonic = 6558.112414
Model1a = '
LdEf ~ a * TFL_C
TFL_C ~ b1 * Extraversion
TFL_C ~ b2 * Agreeableness
'
results1a = sem(Model1a, sample.cov = correl, sample.nobs = harmonic, std = TRUE)
library(lavaan)
?sem
summary(results1a, fit.measures = TRUE, standardized=TRUE, rsquare=TRUE)
semPaths(
results1a,
what = "path",
whatLabels = "stand",
layout = "tree3",
residuals = FALSE,
exoCov = FALSE
)
library(lavaan)
library(semPlot)
#FFM + HH OVERALL (Common Source & Non-Common Source) ####
correl2 = lav_matrix_lower2full(
c(1,
-0.01,	1,
0.42,	0.166721482213838,	1,
0.57,	-0.09,	0.34,	1,
-0.08,	0.77,	0.05,	0.01,	1,
0.22,	0,	0.71,	0.46,	0.12,	1,
-0.16,	0.18,	0.092,	0.26,	0.457,	0.579,	1,
0.188,	0.11,	0.125,	0.343,	0.277,	0.405,	0.627,	1))
rownames(correl2) = colnames(correl2) = c(
"HHSelf",
"ExSelf",
"AgSelf",
"HHOther",
"ExOther",
"AgOther",
"TFL_C",
"LdEf")
harmonic = 1470.280392
Model3a = '
LdEf ~ a * TFL_C
#LdEf ~ HHSelf #added later
TFL_C ~ b1 * HHOther
TFL_C ~ b2 * ExOther
TFL_C ~ b3 * AgOther
#TFL_C ~ HHSelf #added later
HHOther ~~ ExOther
HHOther ~~ AgOther
ExOther ~~ AgOther
HHOther ~ c1 * HHSelf
ExOther ~ c2 * ExSelf
AgOther ~ c3 * AgSelf
'
results3a = sem(Model3a, sample.cov = correl2, sample.nobs = harmonic)
summary(results3a, fit.measures = TRUE, standardized=TRUE, rsquare=TRUE)
semPaths(
results3a,
what = "path",
whatLabels = "stand",
layout = "tree3",
residuals = FALSE,
exoCov = FALSE
)
standardizedSolution(results3a)
library(tm)
library(SentimentAnalysis)
library(tm)
library(psych)
?trimfill
library(metafor)
?trimfill
Sys.setenv(LANGUAGE = "en")
Sys.setenv(LANGUAGE = "en")
sqrt(0.0039)
sqrt(.2265)
sqrt(.0317)
sqrt(.0521)
sqrt(.0112)
sqrt(.0146)
sqrt(.0054)
sqrt(.0001)
sqrt(.0356)
sqrt(.0681)
sqrt(.0021)
sqrt(.2633)
sqrt(.0517)
sqrt(.0035)
sqrt(.0979)
sqrt(.0408)
sqrt(.0086)
sqrt(.0030)
sqrt(.0095)
sqrt(.0551)
sqrt(.0405)
sqrt(.3351)
sqrt(.1560)
sqrt(.0047)
sqrt(.1215)
sqrt(.0038)
sqrt(.0506)
sqrt(.0199)
sqrt(.1396\)
sqrt(.1396)
sqrt(.0329)
sqrt(.2782)
sqrt(.1142)
sqrt(.0019)
sqrt(.0064)
sqrt(.0878)
sqrt(.0778)
sqrt(.0292)
sqrt(.141)
sqrt(.089)
x <- 11
y <- 8
x * y
?rnorm()
dnorm(100)
rnorm(100)
plot(1:100, rnorm(100))
plot(1:100, runif(100))
plot(1:100, sin(1:100))
sin(-100*pi:100*pi)
sin((-100*pi):(100*pi))
?seq()
plot(-10:10,(-10:10)^2)
x <- -10:10
plot(x, x^3 - 3*x^2 + 4x - 14)
plot(x, (x^3 - 3*x^2 + 4x - 14))
plot(x, (x^3 - 3*x^2 + 4*x - 14))
plot(x, (-x^3 - 3*x^2 + 4*x - 14))
plot(x, (-1*x^3 - 3*x^2 + 4*x - 14))
plot(x, (x^3 - 3*x^2 + 4*x - 14))
mean(.056, .073, .107, -.018, .101, -.174, -.256, -.194, -.135, -.147)
sd(.056, .073, .107, -.018, .101, -.174, -.256, -.194, -.135, -.147)
mean(c(.056, .073, .107, -.018, .101, -.174, -.256, -.194, -.135, -.147))
sd(c(.056, .073, .107, -.018, .101, -.174, -.256, -.194, -.135, -.147))
mean(c(.038, .076, .006, .018, -.002, .105, .196, .206, .089, -.075))
sd(c(.038, .076, .006, .018, -.002, .105, .196, .206, .089, -.075))
mean(c(-.051, .112, .135, .179, .093, -.101, -.070, .200, -.044, .121))
sd(c(-.051, .112, .135, .179, .093, -.101, -.070, .200, -.044, .121))
pbinom(0.5, 17, 0.5)
?pbinom
1/(2^17)
pbinom(0.35, 17, 0.5)
pbinom(1, 17, 0.5)
pbinom(0.05, 17, 0.5)
pbinom(0.1, 17, 0.5)
pbinom(0.9, 17, 0.5)
pbinom(c(0.9, 0.1), 17, 0.5)
pbinom(c(0.9, 0.999999), 17, 0.5)
pbinom(0.9, 1, 0.5)
pbinom(0.9, 2, 0.5)
pbinom(0.9, 3, 0.5)
pbinom(0.9, 4, 0.5)
pbinom(0.001, 4, 0.5)
qbinom(0.01, 4, 23)
qbinom(0.01, 4, 0.5)
qbinom(0.1, 4, 0.5)
qbinom(0.0001, 4, 0.5)
qbinom(0.0001, 16, 0.5)
qbinom(0.0001, 16, 0.23)
qbinom(0.0001, 16, 0.25)
0.9……130
0.9^130
0.9^130
0.95^130
0.50^130
0.90^130
129*0.9^129 * 0.1
0.5^139
0.9^139
pbinom(q = 0.5, size = 139, prob = 0.9)
pbinom(q = 0.5, size = 139, prob = 0.1)
0.9^139
library(metafor)
?rma
library(metafor)
?rma
library(thurstonianIRT)
?fit_TIRT_stan
?thurstonianIRT
library(mirt)
?mirt
citation(semTools)
citation("semTools")
?iccde
library(iccde)
?icc.de
load("D:/Full Research Image 0815.RData")
library(iccde)
round(cor(VD_FULLGRM), 2
round(cor(VD_FULLGRM), 2
)
round(cor(VD_FULLGRM), 2)
round(cor(VD_FULLGRM), 2)[1:6,8:19]
VD1 <- round(cor(VD_matrix_FC1)[1:12,14:25], 2)
VD2 <- round(cor(VD_matrix_FC2)[1:12,14:25], 2)
VD3 <- round(cor(VD_matrix_FC3)[1:12,14:25], 2)
VD4 <- round(cor(VD_matrix_FC4)[1:12,14:25], 2)
VD_GRM <- round(cor(VD_FULLGRM), 2)[1:6,8:19]
VD1
VD2
VD_GRM
VD_GRM[1,]
icc.de(VD_GRM[1,], VD1[1,])
icc.de(VD_GRM[1,], VD1[1,])
icc.de(VD_GRM[1,], VD2[1,])
icc.de(VD_GRM[1,], VD3[1,])
icc.de(VD_GRM[1,], VD4[1,])
icc.de(VD_GRM[1,], VD3[1,])
icc.de(VD_GRM[1,], VD4[1,])
icc.de(VD_GRM[1,], VD1[1,])
icc.de(VD_GRM[1,], VD2[1,])
icc.de(VD_GRM[1,], VD3[1,])
icc.de(VD_GRM[1,], VD4[1,])
icc.de(VD_GRM[2,], VD1[2,])
icc.de(VD_GRM[2,], VD2[2,])
icc.de(VD_GRM[2,], VD3[2,])
icc.de(VD_GRM[2,], VD4[2,])
icc.de(VD_GRM[3,], VD1[3,])
icc.de(VD_GRM[3,], VD2[3,])
icc.de(VD_GRM[3,], VD3[3,])
icc.de(VD_GRM[3,], VD4[3,])
VD_GRM
VD1
icc.de(VD_GRM[4,], VD1[4,])
icc.de(VD_GRM[4,], VD2[4,])
icc.de(VD_GRM[4,], VD3[4,])
icc.de(VD_GRM[4,], VD4[4,])
icc.de(VD_GRM[5,], VD1[5,])
icc.de(VD_GRM[5,], VD2[5,])
icc.de(VD_GRM[5,], VD3[5,])
icc.de(VD_GRM[5,], VD4[5,])
VD_FULLGRM <- GRM_ALL %>% select(PID: O) %>% left_join(
full_dataset %>% select(DTDD,DTDD_Mach, DTDD_Psych, DTDD_Narci, CWB, JS, Burnout, FinancialSecurity, OCB, SWB, TI, JP, PHQ, PROLIFIC_PID),
by = c("PID" = "PROLIFIC_PID")
) %>% select(-PID) %>% drop_na()
VD_FULLGRM <- VD_FULLGRM %>% mutate(H = -1*H, C = -1*C, O = -1*O)
VD_GRM <- round(cor(VD_FULLGRM), 2)[1:6,8:19]
library(dplyr)
VD_FULLGRM <- GRM_ALL %>% select(PID: O) %>% left_join(
full_dataset %>% select(DTDD,DTDD_Mach, DTDD_Psych, DTDD_Narci, CWB, JS, Burnout, FinancialSecurity, OCB, SWB, TI, JP, PHQ, PROLIFIC_PID),
by = c("PID" = "PROLIFIC_PID")
) %>% select(-PID) %>% drop_na()
VD_FULLGRM <- VD_FULLGRM %>% mutate(H = -1*H, C = -1*C, O = -1*O)
VD_GRM <- round(cor(VD_FULLGRM), 2)[1:6,8:19]
library(tidyr)
VD_FULLGRM <- GRM_ALL %>% select(PID: O) %>% left_join(
full_dataset %>% select(DTDD,DTDD_Mach, DTDD_Psych, DTDD_Narci, CWB, JS, Burnout, FinancialSecurity, OCB, SWB, TI, JP, PHQ, PROLIFIC_PID),
by = c("PID" = "PROLIFIC_PID")
) %>% select(-PID) %>% drop_na()
VD_FULLGRM <- VD_FULLGRM %>% mutate(H = -1*H, C = -1*C, O = -1*O)
VD_GRM <- round(cor(VD_FULLGRM), 2)[1:6,8:19]
icc.de(VD_GRM[1,], VD1[1,])
icc.de(VD_GRM[1,], VD2[1,])
icc.de(VD_GRM[1,], VD3[1,])
icc.de(VD_GRM[1,], VD4[1,])
icc.de(VD_GRM[5,], VD1[5,])
icc.de(VD_GRM[5,], VD2[5,])
icc.de(VD_GRM[5,], VD3[5,])
icc.de(VD_GRM[5,], VD4[5,])
icc.de(VD_GRM[6,], VD1[6,])
icc.de(VD_GRM[6,], VD2[6,])
icc.de(VD_GRM[6,], VD3[6,])
icc.de(VD_GRM[6,], VD4[6,])
mean(RR_dataset_T2_FC1$RecomInt)
mean(RR_dataset_T2_FC1$RecomInt)/2
sd(RR_dataset_T2_FC1$RecomInt)
sd(RR_dataset_T2_FC1$RecomInt)/4
?icc.de
library(metafor)
?rma
remove.packages("Rcpp")
library(autoFC)
library(dplyr)
library(thurstonianIRT)
updateR()
installr::updateR()
installr::updateR()
installr::updateR()
installr::updateR()
install.packages("lavaan")
install.packages("tidymodels")
library(tidymodels)
install.packages("rlang")
install.packages("rlang")
install.packages("rlang")
update.packages(oldPkgs = "rlang")
library(tidymodels)
install.packages("dials")
library(tidymodels)
install.packages("tidymodels")
install.packages("tidymodels")
update.packages(oldPkgs = "vctrs")
install.packages("mpt2irt")
remotes::install_github("hplieninger/mpt2irt")
install.packages("remotes")
remotes::install_github("hplieninger/mpt2irt")
remotes::install_github("hplieninger/mpt2irtStan")
remotes::install_github("hplieninger/mpt2irt")
?update.packages()
update.packages(instPkgs = c("ps"))
update.packages()
remotes::install_github("hplieninger/mpt2irtStan")
install.packages("Rtools")
install.packages("pkgbuild")
install.packages("pkgbuild")
remotes::install_github("hplieninger/mpt2irtStan")
remotes::install_github("hplieninger/mpt2irtStan")
remotes::install_github("hplieninger/mpt2irt")
remotes::install_github("hplieninger/mpt2irtStan")
install.packages(c("ps","processx","rlang","vctrs"))
install.packages(c("ps","processx","rlang","vctrs"))
install.packages(c("ps", "processx", "rlang", "vctrs"))
install.packages(c("ps", "processx", "rlang", "vctrs"))
Sys.setenv(MAKEFLAGS = paste0("-j",parallel::detectCores()))
install.packages(c("StanHeaders","rstan"),type="source")
example(stan_model, package = "rstan", run.dontrun = TRUE)
remotes::install_github("hplieninger/mpt2irtStan")
remotes::install_github("hplieninger/mpt2irt")
cor(c(1,3,2),c(1,2,3),type = "spearman")
cor(c(1,3,2),c(1,2,3), method = "spearman")
cor(c(3,1,2),c(3,2,1), method = "spearman")
cor(c(3,1,2),c(2,3,1), method = "spearman")
cor(c(3,1,2),c(2,1,3), method = "spearman")
cor(c(3,1,2),c(3,2,,1), method = "spearman")
cor(c(3,1,2),c(3,2,1), method = "spearman")
cor(c(3,1,2,4),c(1,4,2.5,2.5), method = "spearman")
cor(c(4,1,2,3),c(1,4,2.5,2.5), method = "spearman")
cor(c(4,1,2,3),c(1,4,2,2), method = "spearman")
cor(c(4,1,2,3),c(1,4,3,3), method = "spearman")
cran_downloads(packages = c("autoFC"))
library(cranlogs)
cran_downloads(packages = c("autoFC"))
?cran_downloads
cran_downloads(packages = c("autoFC"), from = "2021-01-01")
downloads_count <- cran_downloads(packages = c("autoFC"), from = "2021-01-01")
downloads_count$count
sum(downloads_count$count)
sd(c(1,2,3,4))
sd(c(1,2))
sd(c(3,4))
sd(c(1,3))
sd(c(2.56, 3.24, .369))
sd(c(2.56, 3.24, 3.69))
unlink("D:/Unit Commitment/New Coding/Analysis/UC_Initial_Analysis_cache", recursive = TRUE)
setwd("D:/Anoop Meta-Analysis/ROUND 3 MANUSCRIPT/B5L R&R2 (May 2023)-20230820T064706Z-001/B5L R_R2 (May 2023)/SUPPLEMENTARY MATERIAL_1101/Analysis/3. Moderating Effect of Collectivism")
source("../Utilities/Utilities-Main.R")
source("../Utilities/Utilities-Extra.R")
library(lm.beta)
### Effectiveness
# data_FFM <- readxl::read_excel("../../DataSet/B5L_Analysis_MASTER_NEW1124_NEW.xlsx", sheet = "Coding-Judge_Op")
data_FFM <- readxl::read_excel("../../DataSet/NEW DATASET/B5L_Analysis_MASTER_230830.xlsx", sheet = "Coding-Judge_TEMP")
data_FFM_eff <- data_FFM %>% filter(INCLUDE_AS_JUDGE_OP_S == 1)
# table(data_FFM_eff$`Article ID`)
results <- BF_analysis(data_FFM_eff, IV_name = "IV",
var_names = list(rxx = "rxx", ryy = "ryy", rxy = "rxy", N = "N"))
results$overall[c("E", "A", "C", "N", "O")]
eff_E <- data_FFM_eff %>% filter(IV == 3)
eff_A <- data_FFM_eff %>% filter(IV == 4)
eff_C <- data_FFM_eff %>% filter(IV == 2)
eff_N <- data_FFM_eff %>% filter(IV == 5)
eff_O <- data_FFM_eff %>% filter(IV == 1)
# p = .0266, k = 67
# p = .0347, k = 67 (Using Z)
calculation_mod(eff_E, mods = eff_E$Collectivism, method = "HS", use_Z_mod = FALSE)$result
calculation_mod(eff_E, mods = eff_E$Collectivism)$detail_CI
lm.beta(calculation_mod(eff_E, mods = eff_E$Collectivism)$linear_estimate)
# p = .0356, k = 52
# p = .0659, k = 52 (Using Z)
calculation_mod(eff_A, mods = eff_A$Collectivism, method = "HS", use_Z_mod = FALSE)$result
# p = .0356, k = 52
# p = .0659, k = 52 (Using Z)
calculation_mod(eff_A, mods = eff_A$Collectivism, method = "HS", use_Z_mod = TRUE)$result
setwd("D:/Anoop Meta-Analysis/ROUND 3 MANUSCRIPT/B5L R&R2 (May 2023)-20230820T064706Z-001/B5L R_R2 (May 2023)/SUPPLEMENTARY MATERIAL_1101/Analysis/3. Moderating Effect of Collectivism")
setwd("D:/Anoop Meta-Analysis/ROUND 3 MANUSCRIPT/B5L R&R2 (May 2023)-20230820T064706Z-001/B5L R_R2 (May 2023)/SUPPLEMENTARY MATERIAL_1101/Analysis/4. Path Analyses and Mediator Analyses")
source("../Utilities/Utilities-Main.R")
source("../Utilities/Utilities-Extra.R")
source("../Utilities/MC.R")
cor_FFM_model <- lav_matrix_lower2full(
c(1,
0.26, 1,
0.25, 0.35, 1,
0.35, 0.35, 0.43, 1,
0.43, 0.27, 0.17, 0.19, 1,
0.12, 0.15, 0.02, 0.04, 0.12, 1,
0.32, 0.04, 0.22, 0.12, 0.28, 0.17, 1,
0.11, 0.13, 0.12, 0.11, 0.16, 0.52, 0.39, 1))
colnames(cor_FFM_model) <- c("E", "A", "C", "ES", "O", "CON", "IS", "Eff")
N_FFM_model <- c(22478,
22675, 20018,
23902, 21686, 22904,
24919, 21869, 23289, 22922,
1058, 1054, 1041, 1069, 1091,
1174, 1170, 1041, 1016, 1091, 26295,
37449, 34663, 33537, 19868, 15641, 1960, 1605)
OB_model <- 'CON ~ a1 * C + a2 * E + a3 * ES + a4 * A
IS ~ b1 * C + b2 * E + b3 * ES + b5 * O
Eff ~ c1 * CON + c2 * IS
CON ~~ IS'
fit_OB_model <- sem(OB_model, sample.cov = cor_FFM_model,
sample.nobs = harmonic.mean(c(N_FFM_model)))
harmonic.mean(c(N_FFM_model))
summary(fit_OB_model, standardized = TRUE, fit.measures = TRUE)
modificationindices(fit_OB_model, sort = TRUE)
OB_model_x <- 'CON ~ a1 * C + a2 * E + a3 * ES + a4 * A
IS ~ b1 * C + b2 * E + b3 * ES + b5 * O
Eff ~ c1 * CON + c2 * IS + c3 * E
CON ~~ IS'
fit_OB_model_x <- sem(OB_model_x, sample.cov = cor_FFM_model,
sample.nobs = harmonic.mean(c(N_FFM_model)))
summary(fit_OB_model_x, standardized = TRUE, fit.measures = TRUE)
OB_model_x <- 'CON ~ a1 * C + a2 * E + a3 * ES + a4 * A
IS ~ b1 * C + b2 * E + b3 * ES + b5 * O
Eff ~ c1 * CON + c2 * IS + c3 * ES
CON ~~ IS'
fit_OB_model_x <- sem(OB_model_x, sample.cov = cor_FFM_model,
sample.nobs = harmonic.mean(c(N_FFM_model)))
summary(fit_OB_model_x, standardized = TRUE, fit.measures = TRUE)
summary(fit_OB_model, standardized = TRUE, fit.measures = TRUE)
fit_OB_model_x <- sem(OB_model_x, sample.cov = cor_FFM_model,
sample.nobs = harmonic.mean(c(N_FFM_model)))
summary(fit_OB_model_x, standardized = TRUE, fit.measures = TRUE)
modificationindices(fit_OB_model, sort = TRUE)
MCMed
